#!/bin/bash

PROJECT_NAME=WebHUD
CONFIGURATION=$1
test -z "$CONFIGURATION" && {
	echo "You need to choose a build configuration (Debug, Release)"
	exit 10
}
DSTROOT=$(pwd)/build/$CONFIGURATION/${PROJECT_NAME}.dst
INSTALL_PATH="Library/InputManagers/WebHUD"

test -d "$DSTROOT/$INSTALL_PATH" || {
	echo "does'nt exist: $DSTROOT/$INSTALL_PATH";
	exit 11;
}

test -d "/$INSTALL_PATH" && {
	echo "There's already something in /$INSTALL_PATH -- refusing to overwrite."
	ls -la "/$INSTALL_PATH"
	exit 12;
}

echo "Creating Symlink $DSTROOT/$INSTALL_PATH -> /$INSTALL_PATH"
ln -sf $DSTROOT/$INSTALL_PATH /$INSTALL_PATH

